/*
 * SignHistoryActivity.java
 * business
 *
 * Created by ChenTao on 2017/6/30.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.signhistory;

import android.app.Activity;
import android.content.Intent;

import com.yidiandao.business.R;
import com.yidiandao.business.base.BaseActivity;
import com.yidiandao.business.utils.ActivityUtils;

/** 抽奖记录. */
public class SignHistoryActivity extends BaseActivity {

    private SignHistoryFragment mSignHistoryFragment;

    public static void actionStart(Activity activity) {
        Intent intent = new Intent(activity, SignHistoryActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void initFragment() {
        mSignHistoryFragment =
                (SignHistoryFragment)
                        getSupportFragmentManager().findFragmentById(R.id.container_sign_history);

        if (mSignHistoryFragment == null) {
            mSignHistoryFragment = SignHistoryFragment.getInstance();
            ActivityUtils.addFragmentToActivity(
                    getSupportFragmentManager(), mSignHistoryFragment, R.id.container_sign_history);
        }
    }

    @Override
    protected void initPresenter() {
        new SignHistoryPresenter(mSignHistoryFragment);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_sign_history;
    }
}
